package cn.njxzc.examples;

import java.io.File;

public class Exam9_24 {
	public static void main(String[] args) {
		if (args.length <= 0) {
			System.out.println("no filename argument specified");
			System.exit(0);
		}
	//	String fileName = args[0];
		String fileName="Exam9_3.java";
		File f = new File(fileName);
		System.out.println(f.getAbsolutePath());
	
	if(f.isDirectory()){
		System.out.println("d");
	}else {
		System.out.println("F");
	}
	
		
		if (!f.exists()) {
			System.out.println("can't find " + fileName);
			System.exit(0);
		}
		System.out.println("File " + fileName + " is " + f.length()
				+ " bytes long");
		if (f.isDirectory())
			System.out.println("File " + fileName + " is a directory");
		else
			System.out.println("File " + fileName + " is not a directory");
	}
}
